home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch10d < prev    next >
Encoding:
Text File  |  1991-02-08  |  52.6 KB  |  1,947 lines

  1. Subject:  v12i028:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch10d
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  6. Posting-number: Volume 12, Issue 28
  7. Archive-name: NetHack3/Patch10d
  8. Patch-To: NetHack3: Volume 7, Issue 56-93
  9. Environment: 
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 4 (of 8)."
  20. # Contents:  patch10.04
  21. # Wrapped by billr@saab on Fri Feb  8 17:18:59 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'patch10.04' -a "${1}" != "-c" ; then 
  24.   echo shar: Renaming existing file \"'patch10.04'\" to \"'patch10.04.orig'\"
  25.   mv -f 'patch10.04' 'patch10.04.orig'
  26. fi
  27. echo shar: Extracting \"'patch10.04'\" \(50321 characters\)
  28. sed "s/^X//" >'patch10.04' <<'END_OF_FILE'
  29. X*** others/Makefile.os2    Mon May 21 22:15:49 1990
  30. X--- others/Makefile.os2    Tue Jan 15 17:48:17 1991
  31. X***************
  32. X*** 1,5 ****
  33. X! #    SCCS Id: @(#)Makefile.os2    3.0    90/02/22
  34. X! #    OS/2 NetHack 3.0 Makefile for Microsoft(tm) C 5.1 -- Timo Hakulinen
  35. X  #
  36. X  #    NDMAKE ver 4.5 or MS-NMAKE is required, MS-MAKE will not work.
  37. X  #    To enable either make utility, uncomment the respective
  38. X--- 1,6 ----
  39. X! #    SCCS Id: @(#)Makefile.os2    3.0    91/01/13
  40. X! #    OS/2 NetHack 3.0 Makefile for Microsoft(tm) C 5.1 and 6.0
  41. X! #    -- Timo Hakulinen
  42. X  #
  43. X  #    NDMAKE ver 4.5 or MS-NMAKE is required, MS-MAKE will not work.
  44. X  #    To enable either make utility, uncomment the respective
  45. X***************
  46. X*** 27,38 ****
  47. X  
  48. X  # Enable the upper three lines for NDMAKE and lower three for MS-NMAKE.
  49. X  # ($(MAKE) macro is often predefined, so we use $(MAKEBIN) instead).
  50. X! MAKEBIN = make
  51. X! AB    = $*.c
  52. X! CB    = $*.c
  53. X! #MAKEBIN = nmake
  54. X! #AB    = $(@B).c
  55. X! #CB    = $$(@B).c
  56. X  
  57. X  # For those of us who have these on PC.
  58. X  #YACC    = yacc
  59. X--- 28,39 ----
  60. X  
  61. X  # Enable the upper three lines for NDMAKE and lower three for MS-NMAKE.
  62. X  # ($(MAKE) macro is often predefined, so we use $(MAKEBIN) instead).
  63. X! #MAKEBIN = make
  64. X! #AB    = $*.c
  65. X! #CB    = $*.c
  66. X! MAKEBIN = nmake
  67. X! AB    = $(@B).c
  68. X! CB    = $$(@B).c
  69. X  
  70. X  # For those of us who have these on PC.
  71. X  #YACC    = yacc
  72. X***************
  73. X*** 45,72 ****
  74. X  LEXYYC    = lexyy.c
  75. X  
  76. X  # Directories (makedefs hardcodes these, don't change them).
  77. X! INCL    = ..\include
  78. X! AUX    = ..\auxil
  79. X! SRC    = ..\src
  80. X! OBJ    = $(SRC)\o2
  81. X  
  82. X  # The game name and description.
  83. X  GAME    = nethack
  84. X  GAMEDES = NetHack 3.0
  85. X  
  86. X- # The game directory.
  87. X- GAMEDIR = \games\$(GAME)
  88. X- 
  89. X  # Memory model, compile only, disable optimization, remove stack probes,
  90. X  # 80286 instruction set, dedicated datasegment for items >= 5 bytes,
  91. X  # pack structures on 1 byte boundaries, generate code for 8087
  92. X  # coprocessor, compiler warning level, include file path.
  93. X! CFLAGS    = /AL /c /Od /Gs /G2 /Gt5 /Zp1 /FPi87 /W1 /I$(INCL) $(CDFLAGS)
  94. X  
  95. X  # + prepare for CodeView symbolic debugger.
  96. X  CDFLAGS =
  97. X  #CDFLAGS = /Zi
  98. X  
  99. X  # Don't ignore case in symbols, no default lib search, stack 4096 bytes.
  100. X  # (actually a bit of overkill), allow max 1024 segments in program.
  101. X  LFLAGS    = /noig /nod /stack:4096 /seg:1024 $(LDFLAGS)
  102. X--- 46,79 ----
  103. X  LEXYYC    = lexyy.c
  104. X  
  105. X  # Directories (makedefs hardcodes these, don't change them).
  106. X! INCL    = ..\include        # NetHack include files
  107. X! AUX    = ..\auxil        # NetHack data and documentation
  108. X! SRC    = ..\src        # NetHack source
  109. X  
  110. X+ # Modifiable directories.
  111. X+ OBJ    = $(SRC)\o2        # Object files
  112. X+ PLIBP    = c:\libp        # Protected mode C libraries
  113. X+ RLIBP    = c:\lib        # Real mode C libraries
  114. X+ GAMEDIR = \games\nethack    # The game directory
  115. X+ 
  116. X  # The game name and description.
  117. X  GAME    = nethack
  118. X  GAMEDES = NetHack 3.0
  119. X  
  120. X  # Memory model, compile only, disable optimization, remove stack probes,
  121. X  # 80286 instruction set, dedicated datasegment for items >= 5 bytes,
  122. X  # pack structures on 1 byte boundaries, generate code for 8087
  123. X  # coprocessor, compiler warning level, include file path.
  124. X! CFLAGS    = /AL /c /Od /Gs /G2 /Gt5 /Zp1 /FPi /W1 /I$(INCL) $(CDFLAGS) $(STDC)
  125. X  
  126. X  # + prepare for CodeView symbolic debugger.
  127. X  CDFLAGS =
  128. X  #CDFLAGS = /Zi
  129. X  
  130. X+ # Disable for MSC 5.1, enable for 6.0.
  131. X+ STDC    =
  132. X+ #STDC    = /D__STDC__
  133. X+ 
  134. X  # Don't ignore case in symbols, no default lib search, stack 4096 bytes.
  135. X  # (actually a bit of overkill), allow max 1024 segments in program.
  136. X  LFLAGS    = /noig /nod /stack:4096 /seg:1024 $(LDFLAGS)
  137. X***************
  138. X*** 75,89 ****
  139. X  LDFLAGS =
  140. X  #LDFLAGS = /CO
  141. X  
  142. X! # Protected mode C libraries for 8087 (change if necessary),
  143. X! # OS/2 API entry points.
  144. X! PLIBS    = llibc7p doscalls
  145. X  
  146. X  # C libraries used by makedefs and lev_comp (change if necessary).
  147. X  # If compilation is done in DOS, enable the upper line, if in OS/2,
  148. X  # the lower (protected mode libraries).
  149. X! RLIBS    = llibc7r
  150. X! #RLIBS    = $(PLIBS)
  151. X  
  152. X  # Module definition file for OS/2.
  153. X  OS2DEFS    = $(GAME).def
  154. X--- 82,98 ----
  155. X  LDFLAGS =
  156. X  #LDFLAGS = /CO
  157. X  
  158. X! # Protected mode C libraries for 8087 emulation (change if necessary),
  159. X! # OS/2 API entry points.  For MSC 5.1, enable the upper line
  160. X! # for 6.0 the lower.
  161. X! PLIBS    = $(PLIBP)\llibcep $(PLIBP)\doscalls
  162. X! #PLIBS    = $(PLIBP)\llibcep $(PLIBP)\os2
  163. X  
  164. X  # C libraries used by makedefs and lev_comp (change if necessary).
  165. X  # If compilation is done in DOS, enable the upper line, if in OS/2,
  166. X  # the lower (protected mode libraries).
  167. X! #RLIBS    = $(RLIBP)\llibcer
  168. X! RLIBS    = $(PLIBS)
  169. X  
  170. X  # Module definition file for OS/2.
  171. X  OS2DEFS    = $(GAME).def
  172. X*** others/lev_lex.c    Sun Jun  3 15:03:37 1990
  173. X--- others/lev_lex.c    Tue Feb  5 11:36:47 1991
  174. X***************
  175. X*** 161,170 ****
  176. X--- 161,178 ----
  177. X  int NDECL (yyinput);
  178. X  int NDECL (yywrap);
  179. X  int NDECL (yylex);
  180. X+ # ifdef NeXT
  181. X+ void FDECL (yyunput, (int));
  182. X+ void FDECL (yyoutput, (int));
  183. X+ # else
  184. X  int FDECL (yyunput, (int));
  185. X  int FDECL (yyoutput, (int));
  186. X+ # endif
  187. X  #endif
  188. X  
  189. X+ void FDECL (init_yyin, (FILE *));
  190. X+ void FDECL (init_yyout, (FILE *));
  191. X+ 
  192. X  #ifdef MSDOS
  193. X  #undef exit
  194. X  extern void FDECL(exit, (int));
  195. X***************
  196. X*** 197,203 ****
  197. X  #define YYLMAX    2048
  198. X  
  199. X  #define MAPC 1
  200. X! # line 62 "lev_comp.l"
  201. X  #define YY_END_OF_BUFFER 57
  202. X  typedef int yy_state_type;
  203. X  static const short int yy_accept[274] =
  204. X--- 205,211 ----
  205. X  #define YYLMAX    2048
  206. X  
  207. X  #define MAPC 1
  208. X! # line 70 "lev_comp.l"
  209. X  #define YY_END_OF_BUFFER 57
  210. X  typedef int yy_state_type;
  211. X  static const short int yy_accept[274] =
  212. X***************
  213. X*** 585,596 ****
  214. X          continue; /* go to "YY_DO_BEFORE_ACTION" */
  215. X  
  216. X  case 1:
  217. X! # line 63 "lev_comp.l"
  218. X  { line_number++; yymore(); }    
  219. X      YY_BREAK
  220. X  case 2:
  221. X! # line 64 "lev_comp.l"
  222. X! { BEGIN 0;
  223. X            line_number++;
  224. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  225. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  226. X--- 593,617 ----
  227. X          continue; /* go to "YY_DO_BEFORE_ACTION" */
  228. X  
  229. X  case 1:
  230. X! # line 71 "lev_comp.l"
  231. X  { line_number++; yymore(); }    
  232. X      YY_BREAK
  233. X  case 2:
  234. X! # line 72 "lev_comp.l"
  235. X! {
  236. X! #ifdef FLEX_SCANNER
  237. X!           /*
  238. X!            * There is a bug in Flex 2.3 patch level < 6
  239. X!            * (absent in previous versions)
  240. X!            * that results in the following behaviour :
  241. X!            * Once you enter an yymore(), you never exit from it.
  242. X!            * This should do the trick!
  243. X!            */
  244. X!           extern int yy_more_len;
  245. X! 
  246. X!           yy_more_len = 0;
  247. X! #endif
  248. X!           BEGIN 0;
  249. X            line_number++;
  250. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  251. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  252. X***************
  253. X*** 599,797 ****
  254. X          }
  255. X      YY_BREAK
  256. X  case 3:
  257. X! # line 71 "lev_comp.l"
  258. X  { line_number++; }
  259. X      YY_BREAK
  260. X  case 4:
  261. X! # line 72 "lev_comp.l"
  262. X  return MAZE_ID;
  263. X      YY_BREAK
  264. X  case 5:
  265. X! # line 73 "lev_comp.l"
  266. X  return LEVEL_ID;
  267. X      YY_BREAK
  268. X  case 6:
  269. X! # line 74 "lev_comp.l"
  270. X  return GEOMETRY_ID;
  271. X      YY_BREAK
  272. X  case 7:
  273. X! # line 75 "lev_comp.l"
  274. X  { BEGIN MAPC; line_number++; }
  275. X      YY_BREAK
  276. X  case 8:
  277. X! # line 76 "lev_comp.l"
  278. X  return OBJECT_ID;
  279. X      YY_BREAK
  280. X  case 9:
  281. X! # line 77 "lev_comp.l"
  282. X  return MONSTER_ID;
  283. X      YY_BREAK
  284. X  case 10:
  285. X! # line 78 "lev_comp.l"
  286. X  return TRAP_ID;
  287. X      YY_BREAK
  288. X  case 11:
  289. X! # line 79 "lev_comp.l"
  290. X  return DOOR_ID;
  291. X      YY_BREAK
  292. X  case 12:
  293. X! # line 80 "lev_comp.l"
  294. X  return DRAWBRIDGE_ID;
  295. X      YY_BREAK
  296. X  case 13:
  297. X! # line 81 "lev_comp.l"
  298. X  return MAZEWALK_ID;
  299. X      YY_BREAK
  300. X  case 14:
  301. X! # line 82 "lev_comp.l"
  302. X  return REGION_ID;
  303. X      YY_BREAK
  304. X  case 15:
  305. X! # line 83 "lev_comp.l"
  306. X  return RANDOM_OBJECTS_ID;
  307. X      YY_BREAK
  308. X  case 16:
  309. X! # line 84 "lev_comp.l"
  310. X  return RANDOM_MONSTERS_ID;
  311. X      YY_BREAK
  312. X  case 17:
  313. X! # line 85 "lev_comp.l"
  314. X  return RANDOM_PLACES_ID;
  315. X      YY_BREAK
  316. X  case 18:
  317. X! # line 86 "lev_comp.l"
  318. X  return ALTAR_ID;
  319. X      YY_BREAK
  320. X  case 19:
  321. X! # line 87 "lev_comp.l"
  322. X  return LADDER_ID;
  323. X      YY_BREAK
  324. X  case 20:
  325. X! # line 88 "lev_comp.l"
  326. X  return NON_DIGGABLE_ID;
  327. X      YY_BREAK
  328. X  case 21:
  329. X! # line 89 "lev_comp.l"
  330. X  return ROOM_ID;
  331. X      YY_BREAK
  332. X  case 22:
  333. X! # line 90 "lev_comp.l"
  334. X  { yylval.i=D_ISOPEN; return DOOR_STATE; }
  335. X      YY_BREAK
  336. X  case 23:
  337. X! # line 91 "lev_comp.l"
  338. X  { yylval.i=D_CLOSED; return DOOR_STATE; }
  339. X      YY_BREAK
  340. X  case 24:
  341. X! # line 92 "lev_comp.l"
  342. X  { yylval.i=D_LOCKED; return DOOR_STATE; }
  343. X      YY_BREAK
  344. X  case 25:
  345. X! # line 93 "lev_comp.l"
  346. X  { yylval.i=D_NODOOR; return DOOR_STATE; }
  347. X      YY_BREAK
  348. X  case 26:
  349. X! # line 94 "lev_comp.l"
  350. X  { yylval.i=D_BROKEN; return DOOR_STATE; }
  351. X      YY_BREAK
  352. X  case 27:
  353. X! # line 95 "lev_comp.l"
  354. X  { yylval.i=W_NORTH; return DIRECTION; }
  355. X      YY_BREAK
  356. X  case 28:
  357. X! # line 96 "lev_comp.l"
  358. X  { yylval.i=W_EAST; return DIRECTION; }
  359. X      YY_BREAK
  360. X  case 29:
  361. X! # line 97 "lev_comp.l"
  362. X  { yylval.i=W_SOUTH; return DIRECTION; }
  363. X      YY_BREAK
  364. X  case 30:
  365. X! # line 98 "lev_comp.l"
  366. X  { yylval.i=W_WEST; return DIRECTION; }
  367. X      YY_BREAK
  368. X  case 31:
  369. X! # line 99 "lev_comp.l"
  370. X  { yylval.i = -1; return RANDOM_TYPE; }
  371. X      YY_BREAK
  372. X  case 32:
  373. X! # line 100 "lev_comp.l"
  374. X  return O_REGISTER;
  375. X      YY_BREAK
  376. X  case 33:
  377. X! # line 101 "lev_comp.l"
  378. X  return M_REGISTER;
  379. X      YY_BREAK
  380. X  case 34:
  381. X! # line 102 "lev_comp.l"
  382. X  return P_REGISTER;
  383. X      YY_BREAK
  384. X  case 35:
  385. X! # line 103 "lev_comp.l"
  386. X  return A_REGISTER;
  387. X      YY_BREAK
  388. X  case 36:
  389. X! # line 104 "lev_comp.l"
  390. X  { yylval.i=1; return LEFT_OR_RIGHT; }
  391. X      YY_BREAK
  392. X  case 37:
  393. X! # line 105 "lev_comp.l"
  394. X  { yylval.i=3; return LEFT_OR_RIGHT; }
  395. X      YY_BREAK
  396. X  case 38:
  397. X! # line 106 "lev_comp.l"
  398. X  { yylval.i=2; return CENTER; }
  399. X      YY_BREAK
  400. X  case 39:
  401. X! # line 107 "lev_comp.l"
  402. X  { yylval.i=1; return TOP_OR_BOT; }
  403. X      YY_BREAK
  404. X  case 40:
  405. X! # line 108 "lev_comp.l"
  406. X  { yylval.i=3; return TOP_OR_BOT; }
  407. X      YY_BREAK
  408. X  case 41:
  409. X! # line 109 "lev_comp.l"
  410. X  { yylval.i=1; return LIGHT_STATE; }
  411. X      YY_BREAK
  412. X  case 42:
  413. X! # line 110 "lev_comp.l"
  414. X  { yylval.i=0; return LIGHT_STATE; }
  415. X      YY_BREAK
  416. X  case 43:
  417. X! # line 111 "lev_comp.l"
  418. X  { yylval.i=A_LAW; return ALIGNMENT; }
  419. X      YY_BREAK
  420. X  case 44:
  421. X! # line 112 "lev_comp.l"
  422. X  { yylval.i=A_NEUTRAL; return ALIGNMENT; }
  423. X      YY_BREAK
  424. X  case 45:
  425. X! # line 113 "lev_comp.l"
  426. X  { yylval.i=A_CHAOS; return ALIGNMENT; }
  427. X      YY_BREAK
  428. X  case 46:
  429. X! # line 114 "lev_comp.l"
  430. X  { yylval.i=1; return ALTAR_TYPE; }
  431. X      YY_BREAK
  432. X  case 47:
  433. X! # line 115 "lev_comp.l"
  434. X  { yylval.i=0; return ALTAR_TYPE; }
  435. X      YY_BREAK
  436. X  case 48:
  437. X! # line 116 "lev_comp.l"
  438. X  { yylval.i=1; return UP_OR_DOWN; }
  439. X      YY_BREAK
  440. X  case 49:
  441. X! # line 117 "lev_comp.l"
  442. X  { yylval.i=0; return UP_OR_DOWN; }
  443. X      YY_BREAK
  444. X  case 50:
  445. X! # line 118 "lev_comp.l"
  446. X  { yylval.i=atoi(yytext); return INTEGER; }
  447. X      YY_BREAK
  448. X  case 51:
  449. X! # line 119 "lev_comp.l"
  450. X  { yytext[yyleng-1] = 0; /* Discard the trailing \" */
  451. X            yylval.map = (char *) alloc(strlen(yytext+1)+1);
  452. X            strcpy(yylval.map, yytext+1); /* Discard the first \" */
  453. X--- 620,818 ----
  454. X          }
  455. X      YY_BREAK
  456. X  case 3:
  457. X! # line 92 "lev_comp.l"
  458. X  { line_number++; }
  459. X      YY_BREAK
  460. X  case 4:
  461. X! # line 93 "lev_comp.l"
  462. X  return MAZE_ID;
  463. X      YY_BREAK
  464. X  case 5:
  465. X! # line 94 "lev_comp.l"
  466. X  return LEVEL_ID;
  467. X      YY_BREAK
  468. X  case 6:
  469. X! # line 95 "lev_comp.l"
  470. X  return GEOMETRY_ID;
  471. X      YY_BREAK
  472. X  case 7:
  473. X! # line 96 "lev_comp.l"
  474. X  { BEGIN MAPC; line_number++; }
  475. X      YY_BREAK
  476. X  case 8:
  477. X! # line 97 "lev_comp.l"
  478. X  return OBJECT_ID;
  479. X      YY_BREAK
  480. X  case 9:
  481. X! # line 98 "lev_comp.l"
  482. X  return MONSTER_ID;
  483. X      YY_BREAK
  484. X  case 10:
  485. X! # line 99 "lev_comp.l"
  486. X  return TRAP_ID;
  487. X      YY_BREAK
  488. X  case 11:
  489. X! # line 100 "lev_comp.l"
  490. X  return DOOR_ID;
  491. X      YY_BREAK
  492. X  case 12:
  493. X! # line 101 "lev_comp.l"
  494. X  return DRAWBRIDGE_ID;
  495. X      YY_BREAK
  496. X  case 13:
  497. X! # line 102 "lev_comp.l"
  498. X  return MAZEWALK_ID;
  499. X      YY_BREAK
  500. X  case 14:
  501. X! # line 103 "lev_comp.l"
  502. X  return REGION_ID;
  503. X      YY_BREAK
  504. X  case 15:
  505. X! # line 104 "lev_comp.l"
  506. X  return RANDOM_OBJECTS_ID;
  507. X      YY_BREAK
  508. X  case 16:
  509. X! # line 105 "lev_comp.l"
  510. X  return RANDOM_MONSTERS_ID;
  511. X      YY_BREAK
  512. X  case 17:
  513. X! # line 106 "lev_comp.l"
  514. X  return RANDOM_PLACES_ID;
  515. X      YY_BREAK
  516. X  case 18:
  517. X! # line 107 "lev_comp.l"
  518. X  return ALTAR_ID;
  519. X      YY_BREAK
  520. X  case 19:
  521. X! # line 108 "lev_comp.l"
  522. X  return LADDER_ID;
  523. X      YY_BREAK
  524. X  case 20:
  525. X! # line 109 "lev_comp.l"
  526. X  return NON_DIGGABLE_ID;
  527. X      YY_BREAK
  528. X  case 21:
  529. X! # line 110 "lev_comp.l"
  530. X  return ROOM_ID;
  531. X      YY_BREAK
  532. X  case 22:
  533. X! # line 111 "lev_comp.l"
  534. X  { yylval.i=D_ISOPEN; return DOOR_STATE; }
  535. X      YY_BREAK
  536. X  case 23:
  537. X! # line 112 "lev_comp.l"
  538. X  { yylval.i=D_CLOSED; return DOOR_STATE; }
  539. X      YY_BREAK
  540. X  case 24:
  541. X! # line 113 "lev_comp.l"
  542. X  { yylval.i=D_LOCKED; return DOOR_STATE; }
  543. X      YY_BREAK
  544. X  case 25:
  545. X! # line 114 "lev_comp.l"
  546. X  { yylval.i=D_NODOOR; return DOOR_STATE; }
  547. X      YY_BREAK
  548. X  case 26:
  549. X! # line 115 "lev_comp.l"
  550. X  { yylval.i=D_BROKEN; return DOOR_STATE; }
  551. X      YY_BREAK
  552. X  case 27:
  553. X! # line 116 "lev_comp.l"
  554. X  { yylval.i=W_NORTH; return DIRECTION; }
  555. X      YY_BREAK
  556. X  case 28:
  557. X! # line 117 "lev_comp.l"
  558. X  { yylval.i=W_EAST; return DIRECTION; }
  559. X      YY_BREAK
  560. X  case 29:
  561. X! # line 118 "lev_comp.l"
  562. X  { yylval.i=W_SOUTH; return DIRECTION; }
  563. X      YY_BREAK
  564. X  case 30:
  565. X! # line 119 "lev_comp.l"
  566. X  { yylval.i=W_WEST; return DIRECTION; }
  567. X      YY_BREAK
  568. X  case 31:
  569. X! # line 120 "lev_comp.l"
  570. X  { yylval.i = -1; return RANDOM_TYPE; }
  571. X      YY_BREAK
  572. X  case 32:
  573. X! # line 121 "lev_comp.l"
  574. X  return O_REGISTER;
  575. X      YY_BREAK
  576. X  case 33:
  577. X! # line 122 "lev_comp.l"
  578. X  return M_REGISTER;
  579. X      YY_BREAK
  580. X  case 34:
  581. X! # line 123 "lev_comp.l"
  582. X  return P_REGISTER;
  583. X      YY_BREAK
  584. X  case 35:
  585. X! # line 124 "lev_comp.l"
  586. X  return A_REGISTER;
  587. X      YY_BREAK
  588. X  case 36:
  589. X! # line 125 "lev_comp.l"
  590. X  { yylval.i=1; return LEFT_OR_RIGHT; }
  591. X      YY_BREAK
  592. X  case 37:
  593. X! # line 126 "lev_comp.l"
  594. X  { yylval.i=3; return LEFT_OR_RIGHT; }
  595. X      YY_BREAK
  596. X  case 38:
  597. X! # line 127 "lev_comp.l"
  598. X  { yylval.i=2; return CENTER; }
  599. X      YY_BREAK
  600. X  case 39:
  601. X! # line 128 "lev_comp.l"
  602. X  { yylval.i=1; return TOP_OR_BOT; }
  603. X      YY_BREAK
  604. X  case 40:
  605. X! # line 129 "lev_comp.l"
  606. X  { yylval.i=3; return TOP_OR_BOT; }
  607. X      YY_BREAK
  608. X  case 41:
  609. X! # line 130 "lev_comp.l"
  610. X  { yylval.i=1; return LIGHT_STATE; }
  611. X      YY_BREAK
  612. X  case 42:
  613. X! # line 131 "lev_comp.l"
  614. X  { yylval.i=0; return LIGHT_STATE; }
  615. X      YY_BREAK
  616. X  case 43:
  617. X! # line 132 "lev_comp.l"
  618. X  { yylval.i=A_LAW; return ALIGNMENT; }
  619. X      YY_BREAK
  620. X  case 44:
  621. X! # line 133 "lev_comp.l"
  622. X  { yylval.i=A_NEUTRAL; return ALIGNMENT; }
  623. X      YY_BREAK
  624. X  case 45:
  625. X! # line 134 "lev_comp.l"
  626. X  { yylval.i=A_CHAOS; return ALIGNMENT; }
  627. X      YY_BREAK
  628. X  case 46:
  629. X! # line 135 "lev_comp.l"
  630. X  { yylval.i=1; return ALTAR_TYPE; }
  631. X      YY_BREAK
  632. X  case 47:
  633. X! # line 136 "lev_comp.l"
  634. X  { yylval.i=0; return ALTAR_TYPE; }
  635. X      YY_BREAK
  636. X  case 48:
  637. X! # line 137 "lev_comp.l"
  638. X  { yylval.i=1; return UP_OR_DOWN; }
  639. X      YY_BREAK
  640. X  case 49:
  641. X! # line 138 "lev_comp.l"
  642. X  { yylval.i=0; return UP_OR_DOWN; }
  643. X      YY_BREAK
  644. X  case 50:
  645. X! # line 139 "lev_comp.l"
  646. X  { yylval.i=atoi(yytext); return INTEGER; }
  647. X      YY_BREAK
  648. X  case 51:
  649. X! # line 140 "lev_comp.l"
  650. X  { yytext[yyleng-1] = 0; /* Discard the trailing \" */
  651. X            yylval.map = (char *) alloc(strlen(yytext+1)+1);
  652. X            strcpy(yylval.map, yytext+1); /* Discard the first \" */
  653. X***************
  654. X*** 798,820 ****
  655. X            return STRING; }
  656. X      YY_BREAK
  657. X  case 52:
  658. X! # line 123 "lev_comp.l"
  659. X  { line_number++; }
  660. X      YY_BREAK
  661. X  case 53:
  662. X! # line 124 "lev_comp.l"
  663. X  ;
  664. X      YY_BREAK
  665. X  case 54:
  666. X! # line 125 "lev_comp.l"
  667. X  { yylval.i = yytext[1]; return CHAR; }
  668. X      YY_BREAK
  669. X  case 55:
  670. X! # line 126 "lev_comp.l"
  671. X  { return yytext[0]; }
  672. X      YY_BREAK
  673. X  case 56:
  674. X! # line 127 "lev_comp.l"
  675. X  ECHO;
  676. X      YY_BREAK
  677. X  case YY_STATE_EOF(INITIAL):
  678. X--- 819,841 ----
  679. X            return STRING; }
  680. X      YY_BREAK
  681. X  case 52:
  682. X! # line 144 "lev_comp.l"
  683. X  { line_number++; }
  684. X      YY_BREAK
  685. X  case 53:
  686. X! # line 145 "lev_comp.l"
  687. X  ;
  688. X      YY_BREAK
  689. X  case 54:
  690. X! # line 146 "lev_comp.l"
  691. X  { yylval.i = yytext[1]; return CHAR; }
  692. X      YY_BREAK
  693. X  case 55:
  694. X! # line 147 "lev_comp.l"
  695. X  { return yytext[0]; }
  696. X      YY_BREAK
  697. X  case 56:
  698. X! # line 148 "lev_comp.l"
  699. X  ECHO;
  700. X      YY_BREAK
  701. X  case YY_STATE_EOF(INITIAL):
  702. X***************
  703. X*** 1105,1111 ****
  704. X      yyin = input_file;
  705. X      yy_init = 1;
  706. X      }
  707. X! # line 127 "lev_comp.l"
  708. X  
  709. X  #ifdef    AMIGA
  710. X  long *alloc(n)
  711. X--- 1126,1132 ----
  712. X      yyin = input_file;
  713. X      yy_init = 1;
  714. X      }
  715. X! # line 148 "lev_comp.l"
  716. X  
  717. X  #ifdef    AMIGA
  718. X  long *alloc(n)
  719. X***************
  720. X*** 1114,1116 ****
  721. X--- 1135,1155 ----
  722. X      return ((long *)malloc (n));
  723. X  }
  724. X  #endif
  725. X+ 
  726. X+ /* routine to switch to another input file; needed for flex */
  727. X+ void init_yyin( input_f )
  728. X+ FILE *input_f;
  729. X+ {
  730. X+ #ifdef FLEX_SCANNER
  731. X+     if (yyin != NULL)
  732. X+         yyrestart(input_f);
  733. X+     else
  734. X+ #endif
  735. X+         yyin = input_f;
  736. X+ }
  737. X+ /* analogous routine (for completeness) */
  738. X+ void init_yyout( output_f )
  739. X+ FILE *output_f;
  740. X+ {
  741. X+     yyout = output_f;
  742. X+ }
  743. X*** others/maintain.ovl    Mon May 28 21:08:14 1990
  744. X--- others/maintain.ovl    Sun Feb  3 15:09:43 1991
  745. X***************
  746. X*** 1,6 ****
  747. X              Maintaining PC NetHack
  748. X!                ========================
  749. X!                Last revision: 1990may27
  750. X  
  751. X  The installation of the system of overlay management that currently
  752. X  brings full-featured NetHack to the IBM PC and compatibles has
  753. X--- 1,6 ----
  754. X              Maintaining PC NetHack
  755. X!              ===========================
  756. X!              Last revision: 1991january31
  757. X  
  758. X  The installation of the system of overlay management that currently
  759. X  brings full-featured NetHack to the IBM PC and compatibles has
  760. X***************
  761. X*** 25,31 ****
  762. X  traditional candidates for the overlaying strategy, however, NetHack
  763. X  does not exhibit strongly phased behaviour; although much of the code
  764. X  is not being used at any one moment, there is comparatively little
  765. X! code that can be confidently said not to be related to or potentially
  766. X  necessary for the immediate progress of the game.
  767. X      Furthermore we wished to develop an overlaying strategy that
  768. X  did _not_ involve intimate knowledge of the operation of the
  769. X--- 25,31 ----
  770. X  traditional candidates for the overlaying strategy, however, NetHack
  771. X  does not exhibit strongly phased behaviour; although much of the code
  772. X  is not being used at any one moment, there is comparatively little
  773. X! code that can confidently be said not to be related to or potentially
  774. X  necessary for the immediate progress of the game.
  775. X      Furthermore we wished to develop an overlaying strategy that
  776. X  did _not_ involve intimate knowledge of the operation of the
  777. X***************
  778. X*** 83,95 ****
  779. X  a function name is typically followed by an open parenthesis if, and
  780. X  only if, it is being declared, defined or invoked; if its address is
  781. X  being taken it will necessarily be followed by some other token.
  782. X! Furthermore (except in the unfortunate case of the ill-conceived
  783. X! new-style ANSI declaration of a function that takes no parameters) it
  784. X! will be observed that the number of parameters to a call of the
  785. X! function (assuming that this number is fixed; if not, I grant, we
  786. X! have a problem) is the same in all these contexts. This implies that
  787. X! if all the modules of a programme are uniformly processed in the
  788. X! context of a macro definition such as
  789. X  
  790. X      #define zook(a,b) plenk(a,b)
  791. X  
  792. X--- 83,95 ----
  793. X  a function name is typically followed by an open parenthesis if, and
  794. X  only if, it is being declared, defined or invoked; if its address is
  795. X  being taken it will necessarily be followed by some other token.
  796. X! Furthermore it will be observed that (except in the unfortunate case
  797. X! of the ill-conceived new-style ANSI declaration of a function that
  798. X! takes no parameters) the number of parameters to a call of the
  799. X! function (assuming that this number is fixed; if not, I grant, we have
  800. X! a problem) is the same in all these contexts. This implies that if all
  801. X! the modules of a programme are uniformly processed in the context of a
  802. X! macro definition such as
  803. X  
  804. X      #define zook(a,b) plenk(a,b)
  805. X  
  806. X***************
  807. X*** 99,108 ****
  808. X  map will report the existence of the function plenk() in place of
  809. X  zook() -- UNLESS there was a place in the programme where the address
  810. X  of zook was taken. In that case, the linker would report an
  811. X! unresolved external reference for that symbol.
  812. X      That unresolved reference is, of course, precisely what we
  813. X  need; if in another source file (one that did not see the macro
  814. X! definition) we placed the function declaration
  815. X  
  816. X      some_t zook(this_t a, that_t b)
  817. X        { extern some_t plenk(this_t, that_t);
  818. X--- 99,108 ----
  819. X  map will report the existence of the function plenk() in place of
  820. X  zook() -- UNLESS there was a place in the programme where the address
  821. X  of zook was taken. In that case, the linker would report an
  822. X! unresolved external reference for zook.
  823. X      That unresolved reference is, of course, precisely what we
  824. X  need; if in another source file (one that did not see the macro
  825. X! definition) we placed the function definition
  826. X  
  827. X      some_t zook(this_t a, that_t b)
  828. X        { extern some_t plenk(this_t, that_t);
  829. X***************
  830. X*** 218,224 ****
  831. X  is, quite daftly to my mind, that the linker considers the identity
  832. X  of segment names and combine classes better reason to combine
  833. X  segments than the programmer's explicit instructions in the requested
  834. X! overlay pattern are reason to keep them apart. Programmer, ask not
  835. X  why...).
  836. X  
  837. X  Once again, that works fine except for the small matter of
  838. X--- 218,224 ----
  839. X  is, quite daftly to my mind, that the linker considers the identity
  840. X  of segment names and combine classes better reason to combine
  841. X  segments than the programmer's explicit instructions in the requested
  842. X! overlay pattern is reason to keep them apart. Programmer, ask not
  843. X  why...).
  844. X  
  845. X  Once again, that works fine except for the small matter of
  846. X***************
  847. X*** 301,308 ****
  848. X  change or restructuring of the NetHack source code, which must remain
  849. X  portable to many platforms other than the PC.
  850. X  
  851. X! If these observations do not daunt you, you are a true Bit Warrior
  852. X! indeed (or aspiration anyway), and we await your comments with bait.
  853. X  
  854. X  ------------------------------------------------------------------------
  855. X  
  856. X--- 301,308 ----
  857. X  change or restructuring of the NetHack source code, which must remain
  858. X  portable to many platforms other than the PC.
  859. X  
  860. X! If these observations do not daunt you, you are a Bit Warrior indeed
  861. X! (or aspiration anyway), and we await your comments with bait.
  862. X  
  863. X  ------------------------------------------------------------------------
  864. X  
  865. X***************
  866. X*** 331,336 ****
  867. X      same time.
  868. X  
  869. X  ------------------------------------------------------------------------
  870. X! Stephen P Spackman                             stephen@tira.uchicago.edu
  871. X  ------------------------------------------------------------------------
  872. X                   * Hack On! *
  873. X--- 331,336 ----
  874. X      same time.
  875. X  
  876. X  ------------------------------------------------------------------------
  877. X! Stephen P Spackman                         stephen@estragon.uchicago.edu
  878. X  ------------------------------------------------------------------------
  879. X                   * Hack On! *
  880. X*** others/msdos.c    Tue Jun 26 21:20:12 1990
  881. X--- others/msdos.c    Mon Feb  4 09:56:57 1991
  882. X***************
  883. X*** 1369,1374 ****
  884. X--- 1369,1375 ----
  885. X  {
  886. X      int fromfd, tofd, r;
  887. X      char *buf;
  888. X+     extern genericptr_t FDECL(malloc, (size_t));
  889. X  
  890. X      if ((fromfd = open(from, O_RDONLY|O_BINARY, 0)) < 0)
  891. X          return -1;
  892. X***************
  893. X*** 1393,1402 ****
  894. X--- 1394,1410 ----
  895. X  init_aline()
  896. X  {
  897. X  # ifdef __GNUC__
  898. X+ /* line A calls nuke registers d0-d2,a0-a2; not all compilers regard these
  899. X+    as scratch registers, though, so we save them
  900. X+  */
  901. X+     asm(" moveml d0-d2/a0-a2, sp@-");
  902. X      asm(" .word 0xa000; movel d0, __a_line");
  903. X+     asm(" moveml sp@+, d0-d2/a0-a2");
  904. X  # else
  905. X+     asm(" movem.l d0-d2/a0-a2, -(sp)");
  906. X      asm(" .dc.w 0xa000");    /* tweak as necessary for your compiler */
  907. X      asm(" move.l d0, __a_line");
  908. X+     asm(" movem.l (sp)+, d0-d2/a0-a2");
  909. X  # endif
  910. X  }
  911. X  
  912. X*** others/ovlmgr.asm    Mon May 28 00:49:26 1990
  913. X--- others/ovlmgr.asm    Sun Feb  3 12:33:52 1991
  914. X***************
  915. X*** 1,13 ****
  916. X! ;    SCCS Id: @(#)ovlmgr.asm         90/05/27
  917. X! ;  Copyright (c) 1989, 1990 Pierre Martineau and Stephen Spackman. All Rights Reserved.
  918. X  ;  This product may be freely redistributed.  See NetHack license for details.
  919. X  
  920. X! VERSION     EQU    3081h
  921. X  
  922. X          PAGE    57,132
  923. X          TITLE    'DOS Overlay Manager for MSC 5.1+'
  924. X!         SUBTTL    'Copyright (c) 1989, 1990 Pierre Martineau and Stephen Spackman. All Rights Reserved.'
  925. X  
  926. X  ; acknowledgements:   - Many thanks to Norm Meluch for his invaluable help
  927. X  ;              - No thanks to Microsoft
  928. X  ;              - alltrsidsctysti!!!
  929. X--- 1,15 ----
  930. X! ;    SCCS Id: @(#)ovlmgr.asm         91/02/01
  931. X! ;  Copyright (c) 1989, 1990, 1991 Pierre Martineau and Stephen Spackman. All Rights Reserved.
  932. X  ;  This product may be freely redistributed.  See NetHack license for details.
  933. X  
  934. X! VERSION     EQU    30a0h
  935. X  
  936. X          PAGE    57,132
  937. X          TITLE    'DOS Overlay Manager for MSC 5.1+'
  938. X!         SUBTTL    'Copyright (c) 1989, 1990, 1991 Pierre Martineau and Stephen Spackman. All Rights Reserved.'
  939. X  
  940. X+ ; Multiple overlay file support for v30a0 by Norm Meluch with some input from Stephen.
  941. X+ 
  942. X  ; acknowledgements:   - Many thanks to Norm Meluch for his invaluable help
  943. X  ;              - No thanks to Microsoft
  944. X  ;              - alltrsidsctysti!!!
  945. X***************
  946. X*** 20,25 ****
  947. X--- 22,33 ----
  948. X  ;              - the stack is preserved
  949. X  ;              - re-entrancy is not required
  950. X  
  951. X+ ; options:          /Di386    use 80386-specific opcodes
  952. X+ ;                (faster, but no good for weaker machines)
  953. X+ ;              /DNOEMS    omit EMS support
  954. X+ ;                (needed if application uses EMS)
  955. X+ ;              /DNOSPLIT    omit support for external .OVL files
  956. X+ 
  957. X  DOSALLOC    EQU    48h            ; memory allocation
  958. X  DOSFREE     EQU    49h            ; free allocated memory
  959. X  DOSREALLOC    EQU    4ah            ; modify memory block
  960. X***************
  961. X*** 27,32 ****
  962. X--- 35,44 ----
  963. X  DOSSEEK     EQU    42h            ; logical handle seek
  964. X  DOSOPEN     EQU    3dh            ; open handle
  965. X  DOSCLOSE    EQU    3eh            ; close handle
  966. X+ DOSSETDTA    EQU    1ah            ; Set Data transfer area
  967. X+ DOSGETDTA    EQU    2fh            ; Get Data transfer area
  968. X+ DOSSEARCH    EQU    4eh            ; Search for 1st file match
  969. X+ DOSNEXTFILE    EQU    4fh            ; Search for next file match
  970. X  DOSEXEC     EQU    4bh            ; exec child process
  971. X  DOSPUTC     EQU    02h            ; print a char
  972. X  DOSVERSION    EQU    30h            ; get version number
  973. X***************
  974. X*** 41,46 ****
  975. X--- 53,61 ----
  976. X  EMMALLOC    EQU    43h            ; allocate EMM pages
  977. X  EMMMAP        EQU    44h            ; map EMM pages
  978. X  EMMFREE     EQU    45h            ; free EMM pages
  979. X+ MAXNAMESIZE    EQU    50h            ; max path name size
  980. X+ MAXFILES    EQU    0Eh            ; max # of *.OVL files
  981. X+ EXESIGNUM    EQU    5a4dh            ; Exe header signature
  982. X  CR        EQU    0dh
  983. X  LF        EQU    0ah
  984. X  ESCAPE        EQU    1bh
  985. X***************
  986. X*** 57,62 ****
  987. X--- 72,80 ----
  988. X  RELERR        EQU    6
  989. X  EMSERR        EQU    7
  990. X  HDRERR        EQU    8
  991. X+ NAMERR        EQU    9
  992. X+ OVLERR        EQU    10
  993. X+ NOHDRERR    EQU    11
  994. X  
  995. X  ; The following EXTRNs are supplied by the linker
  996. X  
  997. X***************
  998. X*** 84,90 ****
  999. X          ENDM
  1000. X  ENDIF
  1001. X  
  1002. X! ovlflgrec    RECORD    locked:1=0,ems:1=0,loaded:1=0 ; overlay flags
  1003. X  
  1004. X  ; This is a dirty hack. What we need is a virtual segment that will be built
  1005. X  ; by the (our) loader in multiple copies, one per overlay. Unfortunately, this
  1006. X--- 102,110 ----
  1007. X          ENDM
  1008. X  ENDIF
  1009. X  
  1010. X! ovlflgrec    RECORD    locked:1=0,ems:1=0,loaded:1=0,file:4=0,pad:1 ; overlay flags
  1011. X!         ; "file" is the overlay file this overlay is in; 0 is the .EXE
  1012. X!         ; itself. Otherwise, the numbers are arbitrary.
  1013. X  
  1014. X  ; This is a dirty hack. What we need is a virtual segment that will be built
  1015. X  ; by the (our) loader in multiple copies, one per overlay. Unfortunately, this
  1016. X***************
  1017. X*** 107,113 ****
  1018. X  
  1019. X  ; NOTE: This segment definition MUST be exactly 16 bytes long
  1020. X  
  1021. X! ovlflg        ovlflgrec    <0,0,0>     ; overlay flags
  1022. X  ovlinvcnt    DB    ?            ; invocation count
  1023. X  ovlmemblk    DW    ?            ; ^ to allocated memory block
  1024. X  ovllrudat    DD    ?            ; misc lru data (pseudo time stamp)
  1025. X--- 127,133 ----
  1026. X  
  1027. X  ; NOTE: This segment definition MUST be exactly 16 bytes long
  1028. X  
  1029. X! ovlflg        ovlflgrec    <0,0,0,0,0>     ; overlay flags
  1030. X  ovlinvcnt    DB    ?            ; invocation count
  1031. X  ovlmemblk    DW    ?            ; ^ to allocated memory block
  1032. X  ovllrudat    DD    ?            ; misc lru data (pseudo time stamp)
  1033. X***************
  1034. X*** 127,134 ****
  1035. X  
  1036. X  ovltbl        ENDS
  1037. X  
  1038. X  EXEHDR        STRUC                ; structure of an EXE header
  1039. X! exesign     DW    5a4dh            ; signature
  1040. X  exelstpgesiz    DW    ?            ; last page size (512 byte pages)
  1041. X  exesiz        DW    ?            ; total pages (including partial last page)
  1042. X  relocitems    DW    ?            ; number of relocation entries
  1043. X--- 147,165 ----
  1044. X  
  1045. X  ovltbl        ENDS
  1046. X  
  1047. X+ DTASTRUC    STRUC                ; internal DTA for ovlmgr
  1048. X+         DB    21 DUP (0)
  1049. X+ file_attr    DB    0
  1050. X+ file_time    DW    0
  1051. X+ file_date    DW    0
  1052. X+ file_size    DD    0
  1053. X+ file_name    DB    9 DUP (0)
  1054. X+ file_ext    DB    3 DUP (0)
  1055. X+ dtapad        DB    86 DUP (0)        ; Pad to 128 bytes
  1056. X+ DTASTRUC    ENDS
  1057. X+ 
  1058. X  EXEHDR        STRUC                ; structure of an EXE header
  1059. X! exesign     DW    EXESIGNUM        ; signature
  1060. X  exelstpgesiz    DW    ?            ; last page size (512 byte pages)
  1061. X  exesiz        DW    ?            ; total pages (including partial last page)
  1062. X  relocitems    DW    ?            ; number of relocation entries
  1063. X***************
  1064. X*** 176,182 ****
  1065. X  dsreg        DW    ?            ; temp save area
  1066. X  ssreg        DW    ?
  1067. X  spreg        DW    ?
  1068. X! ovlexefilhdl    DW    -1            ; always-open file handle of our .EXE
  1069. X  ovltblbse    DW    -1            ; segment of first overlay descriptor
  1070. X  memblks     DW    16 DUP (-1)        ; allocated memory blocks
  1071. X  memblk1st    DW    ?            ; first memory block
  1072. X--- 207,213 ----
  1073. X  dsreg        DW    ?            ; temp save area
  1074. X  ssreg        DW    ?
  1075. X  spreg        DW    ?
  1076. X! ovlfilhdl    DW    MAXFILES+1 DUP (-1)      ; always-open file handles for .EXE, .OVL
  1077. X  ovltblbse    DW    -1            ; segment of first overlay descriptor
  1078. X  memblks     DW    16 DUP (-1)        ; allocated memory blocks
  1079. X  memblk1st    DW    ?            ; first memory block
  1080. X***************
  1081. X*** 196,217 ****
  1082. X  hdr        EXEHDR    <>            ; EXE header work area
  1083. X          DB    512-TYPE EXEHDR DUP (?) ; exe hdr buffer for relocations
  1084. X  EXEHDRTMPSIZ    EQU    $ - hdr         ; size of temp reloc buffer
  1085. X  errortbl    DW    -1            ; error message pointers
  1086. X          DW    OFFSET baddos
  1087. X          DW    OFFSET nofile
  1088. X          DW    OFFSET noroom
  1089. X!         DW    OFFSET nofile
  1090. X          DW    OFFSET nocore
  1091. X          DW    OFFSET nocore
  1092. X          DW    OFFSET badems
  1093. X!         DW    OFFSET nofile
  1094. X          DW    OFFSET unknown
  1095. X          DW    OFFSET unknown
  1096. X          DW    OFFSET unknown
  1097. X          DW    OFFSET unknown
  1098. X-         DW    OFFSET unknown
  1099. X-         DW    OFFSET unknown
  1100. X-         DW    OFFSET unknown
  1101. X  emmname     DB    "EMMXXXX0"              ; EMM device driver name
  1102. X  emmtot        DW    0            ; total emm blocks free
  1103. X  emmframesiz    DW    4            ; frame size in blocks
  1104. X--- 227,254 ----
  1105. X  hdr        EXEHDR    <>            ; EXE header work area
  1106. X          DB    512-TYPE EXEHDR DUP (?) ; exe hdr buffer for relocations
  1107. X  EXEHDRTMPSIZ    EQU    $ - hdr         ; size of temp reloc buffer
  1108. X+ filestring    DB    MAXNAMESIZE DUP (0)    ; string space for file specs
  1109. X+ pathlen        DW    ?            ; path length of file spec
  1110. X+ namelen        DW    ?            ; length of file names
  1111. X+ ovldta        DTASTRUC <>            ; DTA for ovlmgr use
  1112. X+ dtaseg        DW    ?            ; DTA segment for program
  1113. X+ dtaoffset    DW    ?            ; DTA offset for program
  1114. X  errortbl    DW    -1            ; error message pointers
  1115. X          DW    OFFSET baddos
  1116. X          DW    OFFSET nofile
  1117. X          DW    OFFSET noroom
  1118. X!         DW    OFFSET badio
  1119. X          DW    OFFSET nocore
  1120. X          DW    OFFSET nocore
  1121. X          DW    OFFSET badems
  1122. X!         DW    OFFSET badhdr
  1123. X!         DW    OFFSET badnam
  1124. X!         DW    OFFSET noovl
  1125. X!         DW    OFFSET nohdr
  1126. X          DW    OFFSET unknown
  1127. X          DW    OFFSET unknown
  1128. X          DW    OFFSET unknown
  1129. X          DW    OFFSET unknown
  1130. X  emmname     DB    "EMMXXXX0"              ; EMM device driver name
  1131. X  emmtot        DW    0            ; total emm blocks free
  1132. X  emmframesiz    DW    4            ; frame size in blocks
  1133. X***************
  1134. X*** 222,236 ****
  1135. X  paragraphs    DB    'H paragraphs.',CR,LF,'$'
  1136. X  emsavl        DB    'EMS memory available: $'
  1137. X  pages        DB    'H 16K-pages.',CR,LF,'$'
  1138. X  noroom        DB    'Not enough free memory left to run this program.$'
  1139. X  nocore        DB    'Internal memory allocation failure.$'
  1140. X- nofile        DB    'Inaccessible EXE file. Can',27,'t load overlays.$'
  1141. X- baddos        DB    'Incorrect DOS version. Must be 3.00 or later.$'
  1142. X  badems        DB    'EMS memory manager error.$'
  1143. X  unknown     DB    'Unknown error!$'
  1144. X  msghead     DB    ESCAPE,'[0m',ESCAPE,'[K',CR,LF,ESCAPE,'[K',ESCAPE,'[1mOVLMGR:',ESCAPE,'[0m $'
  1145. X  diag        DB    ESCAPE,'[K',CR,LF,ESCAPE,'[K','        ($'
  1146. X  msgtail     DB    ESCAPE,'[K',CR,LF,ESCAPE,'[K',BELL,'$'
  1147. X  
  1148. X  ;-------------------------------------------------------------------------------
  1149. X  
  1150. X--- 259,279 ----
  1151. X  paragraphs    DB    'H paragraphs.',CR,LF,'$'
  1152. X  emsavl        DB    'EMS memory available: $'
  1153. X  pages        DB    'H 16K-pages.',CR,LF,'$'
  1154. X+ baddos        DB    'Incorrect DOS version. Must be 3.00 or later.$'
  1155. X+ nofile        DB    'Inaccessible EXE file. Can',39,'t load overlays.$'
  1156. X  noroom        DB    'Not enough free memory left to run this program.$'
  1157. X+ badio        DB    'File I/O error.$'
  1158. X  nocore        DB    'Internal memory allocation failure.$'
  1159. X  badems        DB    'EMS memory manager error.$'
  1160. X+ badhdr        DB    'Executable or overlay header missing or damaged.$'
  1161. X+ badnam        DB    'Unable to resolve overlay file names.$'
  1162. X+ noovl        DB    'Inaccessible OVL file. Can',39,'t load overlays.$'
  1163. X+ nohdr        DB    'Incomplete executable.  OVL files missing?$'
  1164. X  unknown     DB    'Unknown error!$'
  1165. X  msghead     DB    ESCAPE,'[0m',ESCAPE,'[K',CR,LF,ESCAPE,'[K',ESCAPE,'[1mOVLMGR:',ESCAPE,'[0m $'
  1166. X  diag        DB    ESCAPE,'[K',CR,LF,ESCAPE,'[K','        ($'
  1167. X  msgtail     DB    ESCAPE,'[K',CR,LF,ESCAPE,'[K',BELL,'$'
  1168. X+ ovlext        DB    '?.OVL',0
  1169. X  
  1170. X  ;-------------------------------------------------------------------------------
  1171. X  
  1172. X***************
  1173. X*** 247,252 ****
  1174. X--- 290,296 ----
  1175. X          push    bp
  1176. X          push    ds
  1177. X          push    es            ; save the world
  1178. X+ 
  1179. X          cld
  1180. X          mov    ax,ds            ; get our psp
  1181. X          add    ax,10h
  1182. X***************
  1183. X*** 265,279 ****
  1184. X          cmp    WORD PTR [si],0
  1185. X          jnz    envloop
  1186. X          add    si,4            ; point to EXE filename
  1187. X!         mov    al,0            ; access code
  1188. X!         mov    ah,DOSOPEN
  1189. X!         mov    dx,si
  1190. X!         int    DOS            ; open EXE
  1191. X!         jnc    dontdie
  1192. X!         mov    al,FILEERR        ; can't open file!
  1193. X!         jmp    putserr
  1194. X! dontdie:
  1195. X!         mov    ovlexefilhdl,ax     ; save handle
  1196. X  IFNDEF NOEMS
  1197. X  chkems:
  1198. X          mov    ah,DOSGETVEC
  1199. X--- 309,316 ----
  1200. X          cmp    WORD PTR [si],0
  1201. X          jnz    envloop
  1202. X          add    si,4            ; point to EXE filename
  1203. X! 
  1204. X!         call    openfiles        ; Search & open overlay files
  1205. X  IFNDEF NOEMS
  1206. X  chkems:
  1207. X          mov    ah,DOSGETVEC
  1208. X***************
  1209. X*** 316,323 ****
  1210. X  gotovlram:
  1211. X          mov    ovltblbse,ax        ; overlay descriptor table begins at start of memory block
  1212. X  
  1213. X!         push    cs
  1214. X!         pop    ds
  1215. X  IFDEF DEBUG
  1216. X  IFDEF i386
  1217. X          mov    ah,print
  1218. X--- 353,375 ----
  1219. X  gotovlram:
  1220. X          mov    ovltblbse,ax        ; overlay descriptor table begins at start of memory block
  1221. X  
  1222. X!         mov    cx,ovlcnt
  1223. X! zeromem:
  1224. X!         mov    es,ax
  1225. X!         mov    es:ovlflg,0        ; initialise ovl flags
  1226. X!         mov    es:ovlinvcnt,0        ; initialise invocation count
  1227. X!         mov    es:ovlmemblk,0
  1228. X!         mov    WORD PTR es:ovllrudat,0     ; initialise ovl lru
  1229. X!         mov    WORD PTR es:ovllrudat+2,0
  1230. X!         mov    es:ovlemshdl,-1
  1231. X!         mov    es:ovlfiloff,0        ; initialize file offset
  1232. X!         mov    es:ovlsiz,0        ; initialize overlay size
  1233. X!         mov    es:ovlhdrsiz,0
  1234. X!         inc    ax
  1235. X!         loop    zeromem        
  1236. X! 
  1237. X!         mov    ax,cs
  1238. X!         mov    ds,ax
  1239. X  IFDEF DEBUG
  1240. X  IFDEF i386
  1241. X          mov    ah,print
  1242. X***************
  1243. X*** 357,374 ****
  1244. X  
  1245. X          xor    bp,bp
  1246. X          xor    di,di
  1247. X!         xor    si,si
  1248. X  filsegtbllpp:                    ; initialise ovl table
  1249. X          call    gethdr            ; get an EXE header
  1250. X          mov    ax,ovltblbse
  1251. X          add    ax,hdr.exeovlnum
  1252. X          mov    es,ax            ; ^ to ovl table entry
  1253. X!         xor    ax,ax
  1254. X!         mov    WORD PTR ovllrudat,ax    ; initialise ovl lru
  1255. X!         mov    WORD PTR ovllrudat+2,ax
  1256. X!         mov    ovlflg,al        ; initialise ovl flags
  1257. X!         mov    ovlinvcnt,al        ; initialise invocation count
  1258. X!         mov    ovlemshdl,-1
  1259. X          mov    ax,hdr.exesiz
  1260. X          shl    ax,1
  1261. X          shl    ax,1
  1262. X--- 409,426 ----
  1263. X  
  1264. X          xor    bp,bp
  1265. X          xor    di,di
  1266. X!         xor    si,si            ; file handle loop ctr
  1267. X  filsegtbllpp:                    ; initialise ovl table
  1268. X          call    gethdr            ; get an EXE header
  1269. X+ 
  1270. X          mov    ax,ovltblbse
  1271. X          add    ax,hdr.exeovlnum
  1272. X          mov    es,ax            ; ^ to ovl table entry
  1273. X! IFNDEF NOSPLIT
  1274. X!         mov    cx,si            ; set file # in ovlflg
  1275. X!         shl    cx,1
  1276. X!         mov    ovlflg,cl
  1277. X! ENDIF
  1278. X          mov    ax,hdr.exesiz
  1279. X          shl    ax,1
  1280. X          shl    ax,1
  1281. X***************
  1282. X*** 412,423 ****
  1283. X          mov    al,0
  1284. X          mov    ah,DOSSEEK        ; seek to next ovl
  1285. X          int    DOS
  1286. X!         mov    ax,ovlcnt
  1287. X          dec    ax
  1288. X!         cmp    ax,hdr.exeovlnum    ; all overlays done?
  1289. X!         jz    makmemblk
  1290. X!         jmp    filsegtbllpp        ; Nope, go for more.
  1291. X! makmemblk:
  1292. X          ASSUME    ES:nothing        ; prepare first memory block
  1293. X  
  1294. X          mov    ax,ovlrootcode        ; OVERLAY_AREA segment
  1295. X--- 464,490 ----
  1296. X          mov    al,0
  1297. X          mov    ah,DOSSEEK        ; seek to next ovl
  1298. X          int    DOS
  1299. X! 
  1300. X!         mov    cx,ovlcnt        ; check if all overlays found
  1301. X!         mov    ax,ovltblbse
  1302. X!         dec    cx            ; ovlcnt includes root
  1303. X!         add    ax,cx
  1304. X! ovloop:
  1305. X!         mov    es,ax
  1306. X! IFNDEF NOSPLIT
  1307. X!         mov    bl,ovlflg
  1308. X!         and    bx,MASK file
  1309. X! 
  1310. X!         cmp    bx,0            ; if file # is 0
  1311. X!         jne    again
  1312. X! ENDIF
  1313. X!         cmp    ovlfiloff,0        ; and offset is 0
  1314. X!         jne    again
  1315. X!         jmp    filsegtbllpp        ; then we're still looking
  1316. X! again:
  1317. X          dec    ax
  1318. X!         loop    ovloop
  1319. X! 
  1320. X          ASSUME    ES:nothing        ; prepare first memory block
  1321. X  
  1322. X          mov    ax,ovlrootcode        ; OVERLAY_AREA segment
  1323. X***************
  1324. X*** 711,717 ****
  1325. X          adc    cx,0            ; position to code
  1326. X          mov    ah,DOSSEEK        ; lseek to code
  1327. X          mov    al,0            ; from beginning of file
  1328. X!         mov    bx,ovlexefilhdl     ; never closing handle
  1329. X          int    DOS
  1330. X          jc    burnhead        ; oops!
  1331. X          xor    dx,dx            ; buf = ds:0
  1332. X--- 778,786 ----
  1333. X          adc    cx,0            ; position to code
  1334. X          mov    ah,DOSSEEK        ; lseek to code
  1335. X          mov    al,0            ; from beginning of file
  1336. X!         mov    bl,ovlflg
  1337. X!         and    bx,MASK file
  1338. X!         mov    bx,ovlfilhdl[bx]     ; never closing handle
  1339. X          int    DOS
  1340. X          jc    burnhead        ; oops!
  1341. X          xor    dx,dx            ; buf = ds:0
  1342. X***************
  1343. X*** 727,733 ****
  1344. X          pop    cx            ; position of hdr
  1345. X          mov    ah,DOSSEEK        ; lseek to hdr
  1346. X          mov    al,0            ; from beginning of file
  1347. X!         mov    bx,ovlexefilhdl     ; never closing handle
  1348. X          int    DOS
  1349. X          jc    burnhead        ; oops!
  1350. X          mov    cx,EXEHDRTMPSIZ     ; reloc buffer size
  1351. X--- 796,804 ----
  1352. X          pop    cx            ; position of hdr
  1353. X          mov    ah,DOSSEEK        ; lseek to hdr
  1354. X          mov    al,0            ; from beginning of file
  1355. X!         mov    bl,ovlflg
  1356. X!         and    bx,MASK file
  1357. X!         mov    bx,ovlfilhdl[bx]     ; never closing handle
  1358. X          int    DOS
  1359. X          jc    burnhead        ; oops!
  1360. X          mov    cx,EXEHDRTMPSIZ     ; reloc buffer size
  1361. X***************
  1362. X*** 771,777 ****
  1363. X  
  1364. X  ovlrlc        PROC    NEAR            ; ds:0 -> the overlay to relocate
  1365. X  
  1366. X!         ASSUME    DS:NOTHING,ES:NOTHING
  1367. X  
  1368. X          mov    si,OFFSET hdr
  1369. X          mov    bp,si
  1370. X--- 842,848 ----
  1371. X  
  1372. X  ovlrlc        PROC    NEAR            ; ds:0 -> the overlay to relocate
  1373. X  
  1374. X!         ASSUME    DS:NOTHING,ES:ovltbl
  1375. X  
  1376. X          mov    si,OFFSET hdr
  1377. X          mov    bp,si
  1378. X***************
  1379. X*** 808,815 ****
  1380. X          inc    si
  1381. X          add    ax,pspadd        ; now it is psp relative
  1382. X          add    ax,di            ; and now it is relative to the actual load address
  1383. X!         mov    es,ax
  1384. X!         mov    ax,es:[bx]        ; pickup item to relocate
  1385. X          add    ax,pspadd        ; make it psp relative
  1386. X          cmp    ax,ovlrootcode        ; is it below the OVERLAY_AREA?
  1387. X          jc    reloccomputed        ; yup. it's relocated
  1388. X--- 879,886 ----
  1389. X          inc    si
  1390. X          add    ax,pspadd        ; now it is psp relative
  1391. X          add    ax,di            ; and now it is relative to the actual load address
  1392. X!         mov    ds,ax
  1393. X!         mov    ax,[bx]            ; pickup item to relocate
  1394. X          add    ax,pspadd        ; make it psp relative
  1395. X          cmp    ax,ovlrootcode        ; is it below the OVERLAY_AREA?
  1396. X          jc    reloccomputed        ; yup. it's relocated
  1397. X***************
  1398. X*** 817,823 ****
  1399. X          jnc    reloccomputed        ; yup. it's relocated
  1400. X          add    ax,di            ; it's in OVERLAY_AREA, this one's ours.
  1401. X  reloccomputed:
  1402. X!         mov    es:[bx],ax        ; RAM it home!?!
  1403. X          loop    dorelocs        ; what goes around, comes around.
  1404. X  relocdone:    ret
  1405. X  
  1406. X--- 888,894 ----
  1407. X          jnc    reloccomputed        ; yup. it's relocated
  1408. X          add    ax,di            ; it's in OVERLAY_AREA, this one's ours.
  1409. X  reloccomputed:
  1410. X!         mov    [bx],ax            ; RAM it home!?!
  1411. X          loop    dorelocs        ; what goes around, comes around.
  1412. X  relocdone:    ret
  1413. X  
  1414. X***************
  1415. X*** 827,833 ****
  1416. X  
  1417. X  getnxtreloc    PROC    NEAR
  1418. X  
  1419. X!         ASSUME    DS:NOTHING,ES:NOTHING
  1420. X  
  1421. X          push    bx
  1422. X          push    cx
  1423. X--- 898,904 ----
  1424. X  
  1425. X  getnxtreloc    PROC    NEAR
  1426. X  
  1427. X!         ASSUME    DS:NOTHING,ES:ovltbl
  1428. X  
  1429. X          push    bx
  1430. X          push    cx
  1431. X***************
  1432. X*** 839,845 ****
  1433. X          mov    dx,OFFSET hdr
  1434. X          mov    ax,cs
  1435. X          mov    ds,ax
  1436. X!         mov    bx,ovlexefilhdl     ; never closing handle
  1437. X          mov    ah,DOSREAD        ; prevent random DOS behaviour
  1438. X          int    DOS            ; read in header
  1439. X          jnc    nxtrelocok
  1440. X--- 910,918 ----
  1441. X          mov    dx,OFFSET hdr
  1442. X          mov    ax,cs
  1443. X          mov    ds,ax
  1444. X!         mov    bl,ovlflg
  1445. X!         and    bx,MASK file
  1446. X!         mov    bx,ovlfilhdl[bx]     ; never closing handle
  1447. X          mov    ah,DOSREAD        ; prevent random DOS behaviour
  1448. X          int    DOS            ; read in header
  1449. X          jnc    nxtrelocok
  1450. X***************
  1451. X*** 1122,1128 ****
  1452. X          mov    ax,ds            ; this is it!
  1453. X          mov    cx,bx
  1454. X          sub    cx,ax            ; # of paragraphs between start of memory to release and mem blk
  1455. X!         jz    nosplit
  1456. X          push    es
  1457. X          call    splitblk
  1458. X          or    es:memblkflg,MASK_used    ; set high block used
  1459. X--- 1195,1201 ----
  1460. X          mov    ax,ds            ; this is it!
  1461. X          mov    cx,bx
  1462. X          sub    cx,ax            ; # of paragraphs between start of memory to release and mem blk
  1463. X!         jz    unsplit
  1464. X          push    es
  1465. X          call    splitblk
  1466. X          or    es:memblkflg,MASK_used    ; set high block used
  1467. X***************
  1468. X*** 1130,1136 ****
  1469. X          mov    ax,es
  1470. X          mov    ds,ax
  1471. X          pop    es
  1472. X! nosplit:
  1473. X          mov    cx,es:ovlsiz
  1474. X          add    cx,MEMCTLBLKSIZ     ; paragraphs needed to load ovl
  1475. X          jmp    splitblklow        ; split remaining block
  1476. X--- 1203,1209 ----
  1477. X          mov    ax,es
  1478. X          mov    ds,ax
  1479. X          pop    es
  1480. X! unsplit:
  1481. X          mov    cx,es:ovlsiz
  1482. X          add    cx,MEMCTLBLKSIZ     ; paragraphs needed to load ovl
  1483. X          jmp    splitblklow        ; split remaining block
  1484. X***************
  1485. X*** 1620,1648 ****
  1486. X  
  1487. X          ASSUME    DS:NOTHING,ES:NOTHING
  1488. X  
  1489. X-         push    cx
  1490. X-         push    ds
  1491. X-         mov    ax,cs
  1492. X-         mov    ds,ax
  1493. X          mov    dx,OFFSET hdr        ; a place to put it
  1494. X!         mov    bx,ovlexefilhdl     ; the file handle
  1495. X          mov    cx,TYPE EXEHDR        ; header size in bytes
  1496. X          mov    ah,DOSREAD
  1497. X          int    DOS            ; read from file
  1498. X!         jc    exegone         ; oops
  1499. X          cmp    ax,cx            ; got correct number of bytes?
  1500. X!         jnz    exegone         ; nope
  1501. X!         pop    ds
  1502. X!         pop    cx
  1503. X          ret                ; Wow, it worked!
  1504. X  exegone:
  1505. X!         mov    al,HDRERR        ; You lose!
  1506. X!         jmp    putserr
  1507. X  
  1508. X  gethdr        ENDP
  1509. X  
  1510. X  ;-------------------------------------------------------------------------------
  1511. X  
  1512. X  putserr     PROC    NEAR
  1513. X  
  1514. X  ; display error msg, close file, restore int vectors, free mem and return to DOS.
  1515. X--- 1693,1886 ----
  1516. X  
  1517. X          ASSUME    DS:NOTHING,ES:NOTHING
  1518. X  
  1519. X          mov    dx,OFFSET hdr        ; a place to put it
  1520. X!         mov    bx,si
  1521. X!         shl    bx,1
  1522. X!         mov    bx,ovlfilhdl[bx]     ; the file handle
  1523. X! readagain:
  1524. X          mov    cx,TYPE EXEHDR        ; header size in bytes
  1525. X          mov    ah,DOSREAD
  1526. X          int    DOS            ; read from file
  1527. X!         jc    exegone         ; oops?
  1528. X          cmp    ax,cx            ; got correct number of bytes?
  1529. X!         je    gothdr
  1530. X! IFNDEF NOSPLIT
  1531. X!         cmp    ax,0            ; Anything?
  1532. X!         je    gotonxtfil
  1533. X! ENDIF
  1534. X!         jmp    exerotten
  1535. X! IFNDEF NOSPLIT
  1536. X! gotonxtfil:
  1537. X!         inc    si
  1538. X!         cmp    si,MAXFILES+1
  1539. X!         je    exegone            ; We're out of files!
  1540. X!         mov    bx,si
  1541. X!         shl    bx,1
  1542. X!         cmp    ovlfilhdl[bx],-1    ; Any more files?
  1543. X!         je    gotonxtfil        ; not here.
  1544. X! 
  1545. X!         mov    bx,ovlfilhdl[bx]    ; Slide in new handle
  1546. X!         xor    bp,bp            ; reset file offset
  1547. X!         jmp    readagain
  1548. X! ENDIF
  1549. X! gothdr:
  1550. X!         cmp    hdr.exesign,EXESIGNUM    ; sanity check
  1551. X!         jne    exerotten
  1552. X! 
  1553. X          ret                ; Wow, it worked!
  1554. X  exegone:
  1555. X!         mov    al,NOHDRERR        ; missing overlays!
  1556. X!         jmp    putserr            ; You lose!
  1557. X! IFNDEF NOSPLIT
  1558. X! exerotten:
  1559. X!         mov    al,HDRERR        ; corruption!
  1560. X!         jmp    putserr            ; You lose!
  1561. X! ENDIF
  1562. X  
  1563. X  gethdr        ENDP
  1564. X  
  1565. X  ;-------------------------------------------------------------------------------
  1566. X  
  1567. X+ openfiles    PROC    NEAR            ; Find our cohorts in crime
  1568. X+ 
  1569. X+         push    es
  1570. X+ IFNDEF NOSPLIT
  1571. X+         mov    ah,DOSGETDTA        ; Pick up DTA
  1572. X+         int    DOS            ; and
  1573. X+         mov    dtaseg,es        ; store
  1574. X+         mov    dtaoffset,bx        ; it
  1575. X+ 
  1576. X+         push    ds
  1577. X+         mov    dx,OFFSET ovldta    ; Set new DTA for file search
  1578. X+         mov    ax,cs
  1579. X+         mov    ds,ax            ; point to the right seg
  1580. X+         mov    ah,DOSSETDTA
  1581. X+         int    DOS
  1582. X+         pop    ds            ; set this back for upcoming lodsb
  1583. X+ ENDIF
  1584. X+         mov    cx,MAXNAMESIZE/2
  1585. X+         mov    bx,cs
  1586. X+         mov    es,bx
  1587. X+         mov    di, OFFSET filestring
  1588. X+ 
  1589. X+         rep     movsw                ; load path from si to di
  1590. X+ IFNDEF NOSPLIT
  1591. X+         mov    di, OFFSET filestring
  1592. X+         mov    al,0
  1593. X+         mov    cx,MAXNAMESIZE
  1594. X+         cld
  1595. X+         repne    scasb            ; search null for end of string
  1596. X+ 
  1597. X+         sub    cx,MAXNAMESIZE
  1598. X+         neg    cx
  1599. X+         mov    bx,cx
  1600. X+ 
  1601. X+         cmp    cx,MAXNAMESIZE
  1602. X+         je    searchslash
  1603. X+ 
  1604. X+         dec    bx            ; keep string length
  1605. X+         dec    di            ; cause were past null now
  1606. X+ 
  1607. X+         cmp    bx,7
  1608. X+         jle    patherr            ; "C:\.EXE" = 7
  1609. X+ searchslash:
  1610. X+         mov    al,'\'
  1611. X+         std
  1612. X+         repne    scasb            ; search back for '\'
  1613. X+         cld
  1614. X+ 
  1615. X+         mov    dx,bx
  1616. X+         sub    dx,cx            ; keep file name length
  1617. X+         dec    dx
  1618. X+ 
  1619. X+         mov    cx,0            ; reset for upcoming loop
  1620. X+         mov    pathlen,bx        ; hold these for recall
  1621. X+         mov    namelen,dx
  1622. X+         cmp    dx,12            ; "LONGNAME.EXE" = 12
  1623. X+         jle    openroot        ; Path name too long?
  1624. X+ patherr:
  1625. X+         mov    al,NAMERR        ; real problems here.
  1626. X+         jmp    putserr
  1627. X+ openroot:
  1628. X+ ENDIF
  1629. X+         mov    ax,cs
  1630. X+         mov    ds,ax            ; set ds to code
  1631. X+ 
  1632. X+         mov    dx, OFFSET filestring    ; open root code
  1633. X+         mov    al,0            ; access code
  1634. X+         mov    ah,DOSOPEN
  1635. X+         int    DOS            ; open sez me
  1636. X+         jnc    dontdie
  1637. X+ 
  1638. X+         mov    al,FILEERR        ; can't open root
  1639. X+         jmp    putserr
  1640. X+ dontdie:
  1641. X+         mov    ovlfilhdl[0],ax        ; save handle in array
  1642. X+ IFNDEF NOSPLIT
  1643. X+         cmp    namelen,11        ; Max sized exe name (8.3)?
  1644. X+         jg    bigfilename        ; if not
  1645. X+         inc    pathlen            ; add one to path length
  1646. X+         inc    namelen
  1647. X+ bigfilename:
  1648. X+         mov    di,OFFSET filestring    ; es is still code
  1649. X+         add    di,pathlen
  1650. X+         sub    di,5            ; append
  1651. X+         mov    si,OFFSET ovlext    ; wildcard extension
  1652. X+         mov    cx,6            ; and null
  1653. X+         rep    movsb            ; to filestring
  1654. X+ 
  1655. X+         mov    cx,0            ; Match "normal" files
  1656. X+         mov    dx,OFFSET filestring
  1657. X+         mov    ah,DOSSEARCH
  1658. X+         int    DOS            ; Set DTA with Wildcard.
  1659. X+         jc    aok            ; Not a single match
  1660. X+         mov    cx,MAXFILES        ; set upcoming loop
  1661. X+         mov    dx,namelen
  1662. X+         sub    pathlen,dx        ; shorten absolute path
  1663. X+ openloop:
  1664. X+         push    cx
  1665. X+         mov    bx,pathlen
  1666. X+         mov    di,OFFSET filestring    ; es is still in code
  1667. X+         add    di,bx
  1668. X+         mov    si,OFFSET ovldta.file_name
  1669. X+         mov    cx,namelen         ; since this *should* be
  1670. X+         rep    movsb
  1671. X+         pop    cx
  1672. X+ 
  1673. X+         mov    dx,OFFSET filestring    ; path to overlay file
  1674. X+         mov    al,0            ; access code
  1675. X+         mov    ah,DOSOPEN
  1676. X+         int    DOS            ; open overlay file
  1677. X+         jnc    dontdie2
  1678. X+ fileopenerr:
  1679. X+         call    itoa
  1680. X+ 
  1681. X+         mov    al,OVLERR        ; can't open file!
  1682. X+         jmp    putserr
  1683. X+ dontdie2:
  1684. X+         mov    bx,cx            ; put file number in bx
  1685. X+         shl    bx,1            ; 2 * bx for array index
  1686. X+         mov    ovlfilhdl[bx],ax    ; save handle in array
  1687. X+ 
  1688. X+         mov    ah,DOSNEXTFILE        ; Look for more files
  1689. X+         int    DOS
  1690. X+         jc    aok
  1691. X+ 
  1692. X+         loop    openloop        ; open only 15 overlays
  1693. X+ aok:
  1694. X+         mov    dx,dtaoffset        ; Time to unset DTA
  1695. X+         mov    ds,dtaseg
  1696. X+         mov    ah,DOSSETDTA
  1697. X+         int    DOS
  1698. X+ ENDIF
  1699. X+         pop    es
  1700. X+ 
  1701. X+         ret
  1702. X+ 
  1703. X+ openfiles    ENDP
  1704. X+ 
  1705. X+ ;-------------------------------------------------------------------------------
  1706. X+ 
  1707. X  putserr     PROC    NEAR
  1708. X  
  1709. X  ; display error msg, close file, restore int vectors, free mem and return to DOS.
  1710. X***************
  1711. X*** 1739,1750 ****
  1712. X          add    si,2
  1713. X          loop    freeemsmemlp
  1714. X  closefile:
  1715. X!         mov    bx,ovlexefilhdl     ; get file handle
  1716. X          cmp    bx,-1            ; was the file ever opened?
  1717. X          jz    byebye            ; nope
  1718. X          mov    ah,DOSCLOSE        ; close it
  1719. X          int    DOS
  1720. X  byebye:
  1721. X          pop    ax            ; return code in al
  1722. X          mov    ah,TERMINATE
  1723. X          int    DOS            ; terminate this process
  1724. X--- 1977,2000 ----
  1725. X          add    si,2
  1726. X          loop    freeemsmemlp
  1727. X  closefile:
  1728. X! IFNDEF NOSPLIT
  1729. X!         mov    cx,MAXFILES+1
  1730. X! nextfile:
  1731. X!         mov    bx,cx
  1732. X!         dec    bx
  1733. X!         shl    bx,1
  1734. X!         mov    bx,ovlfilhdl[bx]     ; get file handle
  1735. X! ELSE
  1736. X!         mov    bx,ovlfilhdl[0]
  1737. X! ENDIF
  1738. X          cmp    bx,-1            ; was the file ever opened?
  1739. X          jz    byebye            ; nope
  1740. X          mov    ah,DOSCLOSE        ; close it
  1741. X          int    DOS
  1742. X  byebye:
  1743. X+ IFNDEF NOSPLIT
  1744. X+         loop    nextfile
  1745. X+ ENDIF
  1746. X          pop    ax            ; return code in al
  1747. X          mov    ah,TERMINATE
  1748. X          int    DOS            ; terminate this process
  1749. X***************
  1750. X*** 1782,1787 ****
  1751. X--- 2032,2038 ----
  1752. X  
  1753. X  nibble        PROC    NEAR
  1754. X  
  1755. X+         push    ax
  1756. X          and    al,0fh
  1757. X          add    al,30h
  1758. X          cmp    al,3ah
  1759. X***************
  1760. X*** 1788,1796 ****
  1761. X--- 2039,2050 ----
  1762. X          jc    nibok
  1763. X          add    al,7
  1764. X  nibok:
  1765. X+         push    dx
  1766. X          mov    dl,al
  1767. X          mov    ah,DOSPUTC
  1768. X          int    DOS
  1769. X+         pop    dx
  1770. X+         pop    ax
  1771. X          ret
  1772. X  
  1773. X  nibble        ENDP
  1774. X*** others/pcmain.c    Thu May 31 00:00:34 1990
  1775. X--- others/pcmain.c    Sat Jan  5 15:01:44 1991
  1776. X***************
  1777. X*** 107,123 ****
  1778. X  #endif
  1779. X  #ifdef MACOS
  1780. X      AppFile    theFile;
  1781. X!     short    message,numFiles;
  1782. X      SFReply    reply;
  1783. X  
  1784. X      initterm(24,80);
  1785. X      ObscureCursor();
  1786. X  # ifdef SMALLDATA
  1787. X      init_decl();
  1788. X  # endif
  1789. X      /* user might have started up with a save file, so check */
  1790. X!     CountAppFiles(&message,&numFiles);
  1791. X!     if (!message && numFiles) {
  1792. X          message = 1;
  1793. X  
  1794. X          while(message <= numFiles) {
  1795. X--- 107,131 ----
  1796. X  #endif
  1797. X  #ifdef MACOS
  1798. X      AppFile    theFile;
  1799. X!     short    message,numFiles,wizBang = FALSE;
  1800. X      SFReply    reply;
  1801. X  
  1802. X      initterm(24,80);
  1803. X+     /* check to see if is a special "wiz bang" start */
  1804. X+     if (! strcmp(plname, "wizard")) wizBang = TRUE;
  1805. X+ 
  1806. X      ObscureCursor();
  1807. X  # ifdef SMALLDATA
  1808. X      init_decl();
  1809. X  # endif
  1810. X      /* user might have started up with a save file, so check */
  1811. X!     /* however, a "wiz bang" start takes precedence */
  1812. X!     if (wizBang) {
  1813. X!         Strcpy(SAVEF, plname);
  1814. X!         numFiles = 0;
  1815. X!     } else CountAppFiles(&message,&numFiles);
  1816. X! 
  1817. X!     if (numFiles && !message) {
  1818. X          message = 1;
  1819. X  
  1820. X          while(message <= numFiles) {
  1821. X***************
  1822. X*** 392,398 ****
  1823. X      /* initialize static monster strength array */
  1824. X      init_monstr();
  1825. X  #ifdef MACOS
  1826. X!     if (!numFiles) {
  1827. X          askname();
  1828. X          if(justscores){
  1829. X              prscore(1,&classes);
  1830. X--- 400,408 ----
  1831. X      /* initialize static monster strength array */
  1832. X      init_monstr();
  1833. X  #ifdef MACOS
  1834. X!     if (wizBang) wizard = TRUE;
  1835. X! 
  1836. X!     if (!wizBang && !numFiles) {
  1837. X          askname();
  1838. X          if(justscores){
  1839. X              prscore(1,&classes);
  1840. X***************
  1841. X*** 519,525 ****
  1842. X      flags.moonphase = phase_of_the_moon();
  1843. X      if(flags.moonphase == FULL_MOON) {
  1844. X          You("are lucky!  Full moon tonight.");
  1845. X!         if(!u.uluck) change_luck(1);
  1846. X      } else if(flags.moonphase == NEW_MOON) {
  1847. X          pline("Be careful!  New moon tonight.");
  1848. X      }
  1849. X--- 529,535 ----
  1850. X      flags.moonphase = phase_of_the_moon();
  1851. X      if(flags.moonphase == FULL_MOON) {
  1852. X          You("are lucky!  Full moon tonight.");
  1853. X!         change_luck(1);
  1854. X      } else if(flags.moonphase == NEW_MOON) {
  1855. X          pline("Be careful!  New moon tonight.");
  1856. X      }
  1857. X*** others/random.c    Mon Apr 23 21:56:28 1990
  1858. X--- others/random.c    Thu Jan 31 13:35:42 1991
  1859. X***************
  1860. X*** 26,40 ****
  1861. X   *    - ANSI function prototyping in extern.h - therefore include hack.h
  1862. X   *    instead of stdio.h and remove separate declaration of random() from
  1863. X   *    the beginning of function srandom
  1864. X   */
  1865. X  
  1866. X  #ifdef LIBC_SCCS
  1867. X  # ifndef lint
  1868. X  static char sccsid[] = "@(#)random.c    5.5 (Berkeley) 7/6/88";
  1869. X  # endif
  1870. X  #endif /* LIBC_SCCS and not lint */
  1871. X- 
  1872. X- #include "hack.h"
  1873. X  
  1874. X  /*
  1875. X   * random.c:
  1876. X--- 26,42 ----
  1877. X   *    - ANSI function prototyping in extern.h - therefore include hack.h
  1878. X   *    instead of stdio.h and remove separate declaration of random() from
  1879. X   *    the beginning of function srandom
  1880. X+  *    - moving sccsid after hack.h to allow precompiled headers, which
  1881. X+  *    means the defined()s would be ok again...
  1882. X   */
  1883. X  
  1884. X+ #include "hack.h"
  1885. X+ 
  1886. X  #ifdef LIBC_SCCS
  1887. X  # ifndef lint
  1888. X  static char sccsid[] = "@(#)random.c    5.5 (Berkeley) 7/6/88";
  1889. X  # endif
  1890. X  #endif /* LIBC_SCCS and not lint */
  1891. X  
  1892. X  /*
  1893. X   * random.c:
  1894. X*** others/termcap    Sun May 20 20:02:42 1990
  1895. X--- others/termcap    Sat Jan  5 14:59:05 1991
  1896. X***************
  1897. X*** 91,97 ****
  1898. X      :so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
  1899. X      :mb=2\E[5m:md=2\E[1m:mr=2\E[7m:me=2\E[m:\
  1900. X      :ti=4\E<\E(B\E)0:as=^N:ae=^O:\
  1901. X!     :ks=\E[?1h\E=:ke=\E[?11\E>:ku=\E[A:kd=\E[B:kl=\E[C:kr=\E[D:kb=^H:\
  1902. X      :kn#4:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
  1903. X      :sc=\E7:ec=\E8:sr=5\EM:
  1904. X  #
  1905. X--- 91,97 ----
  1906. X      :so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
  1907. X      :mb=2\E[5m:md=2\E[1m:mr=2\E[7m:me=2\E[m:\
  1908. X      :ti=4\E<\E(B\E)0:as=^N:ae=^O:\
  1909. X!     :ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\E[A:kd=\E[B:kl=\E[C:kr=\E[D:kb=^H:\
  1910. X      :kn#4:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
  1911. X      :sc=\E7:ec=\E8:sr=5\EM:
  1912. X  #
  1913. X***************
  1914. X*** 104,109 ****
  1915. X--- 104,111 ----
  1916. X      :ic=5\E[@:tc=vt102:
  1917. X  vt300|vt300-80|vt320|vt330|vt340|VT300_Series:\
  1918. X      :tc=vt200:
  1919. X+ vt400|vt400-80|vt420|VT400_Series:\
  1920. X+     :tc=vt300:
  1921. X  # VAXstations (should have full entries with no delays and 8-bit CSI's)
  1922. X  VWS|UIS:tc=vt200:
  1923. X  DECterm:tc=vt300:
  1924. X
  1925. END_OF_FILE
  1926. if test 50321 -ne `wc -c <'patch10.04'`; then
  1927.     echo shar: \"'patch10.04'\" unpacked with wrong size!
  1928. fi
  1929. # end of 'patch10.04'
  1930. echo shar: End of archive 4 \(of 8\).
  1931. cp /dev/null ark4isdone
  1932. MISSING=""
  1933. for I in 1 2 3 4 5 6 7 8 ; do
  1934.     if test ! -f ark${I}isdone ; then
  1935.     MISSING="${MISSING} ${I}"
  1936.     fi
  1937. done
  1938. if test "${MISSING}" = "" ; then
  1939.     echo You have unpacked all 8 archives.
  1940.     rm -f ark[1-9]isdone
  1941. else
  1942.     echo You still need to unpack the following archives:
  1943.     echo "        " ${MISSING}
  1944. fi
  1945. ##  End of shell archive.
  1946. exit 0
  1947.